export function formatDate(date: string): string {
    let new_date = new Date(date)
    let year = new_date.getFullYear()
    let month: string | number = new_date.getMonth() + 1
    let day: string | number = new_date.getDate()
    let hours: string | number = new_date.getHours()
    let minutes: string | number = new_date.getMinutes()
    if ((month + '').length < 2) {
        month = '0' + month
    }
    if ((day + '').length < 2) {
        day = '0' + day
    } if ((hours + '').length < 2) {
        hours = '0' + hours
    } if ((minutes + '').length < 2) {
        minutes = '0' + minutes
    }
    return `${year}-${month}-${day} ${hours}:${minutes}:00`
}